class MyThread1 extends Thread{
    @Override
    public void run() {
        System.out.println("MyThread1");
    }
}
class MyThread2 implements Runnable{
    @Override
    public void run() {
        System.out.println("MyThread2");
    }
}
public class Demo16 {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
            @Override
            public void run() {
                System.out.println("t1");
            }
        };

        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("t2");
            }
        });

        Thread t3 = new Thread(() -> {
            System.out.println("t3");
        });

        MyThread1 myThread1 = new MyThread1();
        myThread1.start();
        Thread myThread2 = new Thread(new MyThread2());
        myThread2.start();
        t1.start();
        t2.start();
        t3.start();
    }
}
